const mongoose = require('mongoose');
//创建评论集合规则
const commentSchema = new mongoose.Schema({
	aid: {
		type: mongoose.Schema.Types.ObjectId,
		ref: 'Article'
	},
	uid: {
		type: mongoose.Schema.Types.ObjectId,
		ref: 'User'
	},
	//评论时间
	time: Date,
	//评论内容
	content: String
});

//创建评论集合
const Comment = mongoose.model('Comment', commentSchema);

module.exports = {
	Comment
}